package org.heydr.impl;

import org.heydr.common.TaskEngine;
import org.heydr.common.http.HttpSnatcher;
import org.heydr.entity.HttpSnatchParam;
import org.heydr.entity.Page;
import org.heydr.entity.Site;
import org.heydr.entity.Url;

public class SubCrawler {

	public static Page snatch(Url url){
		Site site = TaskEngine.getSite(url.getSite());
		HttpSnatchParam httpSnatchParam = null;
		if(null != site){
			//request params and proxy setting
			httpSnatchParam = site.getHttpSnatchParam();
		}
		if(null == httpSnatchParam)
			httpSnatchParam = new HttpSnatchParam();
		httpSnatchParam.setUrl(url.getUrl());
		
		return HttpSnatcher.getPage(httpSnatchParam);
		
	}
	
}
